import axios from '../request.use'

const documentUrl = 'knowledge/document/'
const courseUrl = 'knowledge/course/'
const lawPolicyUrl = 'law_policy/'
const userUrl = 'user/course/'

// 请求类（ 用户相关 ）
class knowledge {
    // 注册账号
    documentUrl(queryUrl,data) {
        return axios.request({
            url: `${documentUrl}${queryUrl}`,
            method: 'get',
            dataType: 'not',
            data: data
        })
    }
    courseUrl(queryUrl,data) {
        return axios.request({
            url: `${courseUrl}${queryUrl}`,
            method: 'get',
            dataType: 'not',
            data: data
        })
    }
    lawPolicyUrl(queryUrl,data) {
        return axios.request({
            url: `${lawPolicyUrl}${queryUrl}`,
            method: 'get',
            dataType: 'not',
            useToken: true,
            data: data
        })
    }
    postDocumentUrl(queryUrl,data) {
        return axios.request({
            url: `${documentUrl}${queryUrl}`,
            method: 'post',
            dataType: 'not',
            useToken: true,
            data: data
        })
    }
    postCourseUrl(queryUrl,data) {
        return axios.request({
            url: `${courseUrl}${queryUrl}`,
            method: 'post',
            dataType: 'not',
            useToken: true,
            data: data
        })
    }
    postLawPolicyUrl(queryUrl,data) {
        return axios.request({
            url: `${lawPolicyUrl}${queryUrl}`,
            method: 'post',
            dataType: 'not',
            useToken: true,
            data: data
        })
    }
    userUrl(queryUrl,data) {
        return axios.request({
            url: `${userUrl}${queryUrl}`,
            method: 'get',
            dataType: 'not',
            useToken: true,
            data: data
        })
    }
    postUserUrl(queryUrl,data) {
        return axios.request({
            url: `${userUrl}${queryUrl}`,
            method: 'post',
            dataType: 'not',
            useToken: true,
            data: data
        })
    }


}

const knowledgeApi = new knowledge()

export {
    knowledgeApi
}